package cpu ;

class PC
{
	CPU cpu ;
	HardDisk HD ;
	void setCPU ( CPU c )
	{
		cpu = c ;
	}
	void setHardDisk ( HardDisk h )
	{
		HD = h ;
	}
	void show() 
	{
		System.out.println("cpu的速度是："+cpu.speed+"    硬盘的容量是："+HD.amount);
	}
}

class CPU
{
	int speed ;
	int getSpeed () 
	{
		return speed ;
	}
	void setSpeed ( int m ) 
	{
		speed = m ;
	}
}

class HardDisk
{
	int amount ;
	void setAmount ( int m ) 
	{
		amount = m ;
	}
	int getAmount () 
	{
		return amount;
	}
}


public class Test 
{
	public static void main ( String []  args )
	{
		CPU cpu = new CPU() ;
		cpu.speed = 2200 ;
		HardDisk disk = new HardDisk () ;
		disk.amount = 200 ;
		PC pc = new PC () ;
		pc.setCPU ( cpu) ;
		pc.setHardDisk ( disk ) ;
		pc.show();	
	}
}
